package com.bosssoft.setp.handler;

import com.bosssoft.setp.model.system.SlideShow;
import org.springframework.stereotype.Service;
import xyz.erupt.annotation.fun.DataProxy;
import xyz.erupt.core.exception.EruptApiErrorTip;

@Service
public class SlideShowDataProxy implements DataProxy<SlideShow> {

    @Override
    public void beforeAdd (SlideShow slideShow)
    {
        if(slideShow.getSpacing_time()<=0)
        {
            throw new EruptApiErrorTip("时间不能小于0");
        }
    }
    @Override
    public void beforeUpdate (SlideShow slideShow)
    {
        if(slideShow.getSpacing_time()<=0)
        {
            throw new EruptApiErrorTip("时间不能小于0");
        }
    }
}
